package com.rbac.infrastructure.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rbac.domain.entity.RolePermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RolePermissionMapper extends BaseMapper<RolePermission> {

    void deleteByRoleId(@Param("roleId") Long roleId);

    void deleteByRoleIds(@Param("roleIds") List<Long> roleIds);

    void deleteByPermissionId(@Param("permissionId") Long permissionId);

    void insertBatch(@Param("rolePermissions") List<RolePermission> rolePermissions);

    List<Long> getPermissionIdsByRoleId(@Param("roleId") Long roleId);
}